//
//  StatisticsHome.swift
//  CrseAsst
//
//  Created by 申铭 on 2024/2/22.
//

import SwiftUI

struct StatisticsHome: View {
    var body: some View {
        NavigationView {
            ScrollView {
                HStack {
                    HStack{}.frame(width: 15)
                    StatisticsCountCard()
                    Spacer(minLength: 20)
                    StatisticsCountCard()
                    HStack{}.frame(width: 15)
                }
                
                Spacer(minLength: 20)
                
                HStack {
                    HStack{}.frame(width: 15)
                    StatisticsCountCard()
                    Spacer(minLength: 20)
                    StatisticsCountCard()
                    HStack{}.frame(width: 15)
                }
            }
            .navigationBarTitle("统计")
            .navigationBarTitleDisplayMode(.automatic)
        }
    }
}

struct StatisticsCountCard: View {
    var body: some View {
        NavigationLink(destination: FuncView()) {
            VStack {
                HStack {
                    Spacer()
                    Text("Hello, World!")
                        .foregroundColor(.primary)
                    Spacer()
                }
                HStack {
                    Text("Hello, World!")
                        .foregroundColor(.primary)
                }
            }
            .padding()
            .background(Color.gray)
            .cornerRadius(8)
        }
    }
}

#Preview {
    StatisticsHome()
}
